(function webpackUniversalModuleDefinition(root, factory) {
    if (typeof exports === 'object' && typeof module === 'object')
        module.exports = factory();
    else if (typeof define === 'function' && define.amd)
        define([], factory);
    else if (typeof exports === 'object')
        exports["FPHDTaskSdk"] = factory();
    else
        root["FPHDTaskSdk"] = factory();
})(this, function () {
    return (function (modules) {

        var installedModules = {};

        function __webpack_require__(moduleId) {

            // Check if module is in cache
            if (installedModules[moduleId]) {
                return installedModules[moduleId].exports;
            }

            // Create a new module (and put it into the cache)
            var module = installedModules[moduleId] = {
                exports: {},
                id: moduleId,
                loaded: false
            };

            // Execute the module function
            modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);

            // Flag the module as loaded
            module.loaded = true;

            // Return the exports of the module
            return module.exports;
        }

        // expose the module cache
        __webpack_require__.c = installedModules;

        // __webpack_public_path__
        __webpack_require__.p = "/assets/";

        // Load entry module and return exports
        return __webpack_require__(0);
    })([

        function (module, exports, __webpack_require__) {

            'use strict';

            var taskApiServerUrl = '';
            var containsHeight = 0;
            var startScrollTop = 0;
            var startTouchTime = 0;
            var lastTouchTime = 0;
            var lastTime = 0;
            var readTime = 0;
            var isStartRecord = false;
            var fixedTimePassTime = 0;
            var videoTimePassTime = 0;
            var videoTimePassPercent = 0;
            var gameWelfareTaskTimePassTime = 0;
            var timingTaskPassTime = 0;
            var isStartTiming = false;
            var videoSetTimeoutId = 0;
            var isStartVideoTimingTask = false;
            var doingTaskList = {};
            var taskCallback = null;
            var initTaskListDate = '';
            var requestStartTaskList = {};
            var requestDoTaskList = {};
            var startRequestStartTask = 0;
            var startRequestDoTask = 0;


            module.exports = {

                _initApi: function _initApi() {
                    var host = location.host.split("-");
                    if (host.length > 1) {
                        if (host[0] == 'alpha' || host[0] == 'beta') {
                            taskApiServerUrl = location.protocol + '//' + host[0] + '-task.fpwan.com';
                        } else {
                            taskApiServerUrl = location.protocol + '//' + 'task.fpwan.com';
                        }

                    } else {
                        if (host[0].indexOf('localhost') != -1) {
                            taskApiServerUrl = location.protocol + '//' + 'alpha-task.fpwan.com';
                        } else {
                            taskApiServerUrl = location.protocol + '//' + 'task.fpwan.com';
                        }
                    }
                },

                _getNowYearMonthDate: function _getNowYearMonthDate() {

                    var date = new Date();
                    var year = date.getFullYear(); //获取完整的年份(4位)
                    var month = date.getMonth() + 1; //获取当前月份(0-11,0代表1月)
                    var day = date.getDate(); //获取当前日(1-31)

                    return year + '-' + month + '-' + day;
                },

                _createBaseElement: function _createBaseElement(baseElementId, html) {

                    var documentObj = document.getElementById(baseElementId);
                    if (!FPHDSdk.dataIsNull(documentObj)) {
                        documentObj.innerHTML = '';
                    } else {
                        var fphdDiv = document.createElement("fphdtaskdiv");
                        fphdDiv.id = baseElementId;
                        fphdDiv.style.top = "0";
                        fphdDiv.style.left = "0";
                        fphdDiv.style.position = "fixed";
                        fphdDiv.style.display = 'block';
                        fphdDiv.style.width = "100%";
                        fphdDiv.style.height = "100%";
                        fphdDiv.style.background = 'rgba(0, 0, 0, 0.5)';

                        if (baseElementId == 'FPHDTaskHongbaoTipsMessage') {
                            fphdDiv.style.zIndex = "9995";
                        } else if (baseElementId == 'FPHDTaskTipsMessage') {
                            fphdDiv.style.zIndex = "9992";
                        } else if (baseElementId == 'FPHDTaskFindTask' || baseElementId == 'FPHDTaskTimingTask') {
                            fphdDiv.style.zIndex = "100";
                        } else {
                            fphdDiv.style.zIndex = "9990";
                        }

                        document.body.appendChild(fphdDiv);
                    }

                    document.getElementById(baseElementId).innerHTML = html;

                    // 禁止穿透
                    document.getElementById(baseElementId).addEventListener('touchmove', function (e) {
                        e.preventDefault();
                    }, false);

                    return;
                },

                _deleteBaseElement: function _deleteBaseElement(baseElementId) {

                    var documentObj = document.getElementById(baseElementId);
                    if (!FPHDSdk.dataIsNull(documentObj)) {
                        document.body.removeChild(documentObj);
                    }
                    return;
                },

                getTaskList: function getTaskList(channelType, actionType, type, newsId) {
                    console.log('getTaskList', channelType, actionType, type, newsId);
                    // 初始化接口域名
                    FPHDTaskSdk._initApi();
                    if (!taskApiServerUrl) {
                        return;
                    }

                    initTaskListDate = FPHDTaskSdk._getNowYearMonthDate();

                    var FPHDSdkUserInfo = FPHDSdk.getCookie('FPHDSdkUserInfo');
                    FPHDSdkUserInfo = decodeURIComponent(FPHDSdkUserInfo);
                    var FPHDSdkUserInfos = FPHDSdkUserInfo.split("||");

                    // 获取任务列表
                    var postUrl = taskApiServerUrl + "/task/getProcessingList?sign=" + FPHDSdkUserInfos[0] + "&time=" + FPHDSdkUserInfos[1] + "&token=" + FPHDSdkUserInfos[3];
                    FPHDSdk.doGet({
                        url: postUrl,
                        onSuccess: function (data) {
                            var dataObj = eval("(" + data.response + ")");//转换为json对象
                            if (dataObj.code === 0) {
                                FPHDSdk.addSessionStorage("FPHDTaskSdkTaskList", JSON.stringify(dataObj.data.list));

                                if (!FPHDSdk.dataIsNull(channelType)) {
                                    FPHDTaskSdk.isHaveTask(channelType, actionType, type, newsId);
                                }
                            }
                        },
                        onFail: function () {

                        }
                    });

                    // 签到
                    // var postUrl = taskApiServerUrl + "/checkIn/checkInDaily?token=" + FPHDSdkUserInfos[3];
                    // FPHDSdk.doGet({
                    //     url: postUrl,
                    //     onSuccess: function (data) {
                    //
                    //     },
                    //     onFail: function () {
                    //
                    //     }
                    // });
                },

                removeTask: function removeTask() {

                    // 停止阅读
                    isStartRecord = false;

                    // 停止记录视频计时任务
                    isStartVideoTimingTask = false;

                    FPHDTaskSdk._deleteBaseElement('FPHDTaskTipsMessage');
                    FPHDTaskSdk._deleteBaseElement('FPHDCommunityTaskTipsMessage');
                    FPHDTaskSdk._deleteBaseElement('FPHDTaskHongbaoTipsMessage');
                    FPHDTaskSdk._deleteBaseElement('FPHDTaskFindTipsMessage');
                    FPHDTaskSdk._deleteBaseElement('FPHDTaskFindTask');

                    // 存在菜单不删除彩蛋
                    var eggDocumentObj = document.getElementById('circle-bar-award-timing-egg');
                    if (!eggDocumentObj) {
                        FPHDTaskSdk._deleteBaseElement('FPHDTaskTimingTask');
                    }

                    FPHDTaskSdk._deleteBaseElement('FPHDTaskVideoSurpriseHongbao');
                },

                refreshTask: function refreshTask(taskId, callback) {

                    var returnData = {code: 1001, msg: "用户未登录", data: {}};
                    if (!taskId || !callback) {
                        callback(returnData);
                        return;
                    }

                    // 初始化接口域名
                    FPHDTaskSdk._initApi();
                    if (!taskApiServerUrl) {
                        callback(returnData);
                        return;
                    }

                    var FPHDSdkUserInfo = FPHDSdk.getCookie('FPHDSdkUserInfo');
                    FPHDSdkUserInfo = decodeURIComponent(FPHDSdkUserInfo);
                    var FPHDSdkUserInfos = FPHDSdkUserInfo.split("||");

                    // 获取任务列表
                    var postUrl = taskApiServerUrl + "/home/refreshTask?taskId=" + taskId + "&sign=" + FPHDSdkUserInfos[0] + "&time=" + FPHDSdkUserInfos[1] + "&token=" + FPHDSdkUserInfos[3];
                    FPHDSdk.doGet({
                        url: postUrl,
                        onSuccess: function (data) {
                            var dataObj = eval("(" + data.response + ")");//转换为json对象
                            if (dataObj.code === 0) {

                                if (!FPHDSdk.dataIsNull(doingTaskList)) {
                                    // 记录当前看的文章（视频）id
                                    for (var taskId in doingTaskList) {

                                        if (!FPHDSdk.dataIsNull(doingTaskList[taskId].newsId) && dataObj.data.list[taskId]) {
                                            dataObj.data.list[taskId].newsId = doingTaskList[taskId].newsId;
                                        }

                                        if ((doingTaskList[taskId].index === 0 || !FPHDSdk.dataIsNull(doingTaskList[taskId].index)) && dataObj.data.list[taskId]) {
                                            dataObj.data.list[taskId].index = doingTaskList[taskId].index;
                                        }
                                    }
                                }

                                FPHDSdk.addSessionStorage("FPHDTaskSdkTaskList", JSON.stringify(dataObj.data.list));

                                returnData = {code: 0, msg: "success", data: dataObj.data.info};
                                callback(returnData);
                            } else {
                                callback(dataObj);
                            }
                        },
                        onFail: function () {
                            callback(returnData);
                        }
                    });

                },

                isHaveTaskTag: function isHaveTaskTag(newsId) {

                    if (!newsId) {
                        return false;
                    }

                    var taskListJsonStr = FPHDSdk.getSessionStorage("FPHDTaskSdkTaskList");
                    if (FPHDSdk.dataIsNull(taskListJsonStr)) {
                        return false;
                    }

                    var taskList = JSON.parse(taskListJsonStr);
                    if (FPHDSdk.dataIsNull(taskList)) {
                        return false;
                    }

                    for (var index in taskList) {

                        // 文章列表发现任务
                        if (taskList[index]['type'] == 5 && taskList[index]['channelType'].indexOf(1) != -1 && taskList[index]['actionType'] == 1) {

                            // 同一篇文章或视频领取过奖励就不再触发
                            if (newsId && taskList[index]['overTask'] && !FPHDSdk.dataIsNull(taskList[index]['overTask'][newsId])) {
                                return false;
                            }

                            // 文章列表发现任务
                            if (taskList[index].newsId) {

                                if (newsId == taskList[index].newsId) {
                                    return taskList[index]['taskAwardNumber'];
                                } else {
                                    return false;
                                }

                            }

                        }

                    }

                    for (var index in taskList) {

                        // 文章列表发现任务
                        if (taskList[index]['type'] == 5 && taskList[index]['channelType'].indexOf(1) != -1 && taskList[index]['actionType'] == 1) {

                            // 50%概率出现发现任务
                            var random = Math.floor(Math.random() * 100);
                            if (random < taskList[index]['rate']) {

                                taskList[index].newsId = newsId;
                                FPHDSdk.addSessionStorage("FPHDTaskSdkTaskList", JSON.stringify(taskList));
                                return taskList[index]['taskAwardNumber'];
                            }
                        }
                    }

                    return false;
                },

                isHaveTaskBar: function isHaveTaskBar(page) {

                    var taskListJsonStr = FPHDSdk.getSessionStorage("FPHDTaskSdkTaskList");
                    if (FPHDSdk.dataIsNull(taskListJsonStr)) {
                        return false;
                    }

                    var taskList = JSON.parse(taskListJsonStr);
                    if (FPHDSdk.dataIsNull(taskList)) {
                        return false;
                    }

                    for (var index in taskList) {

                        // 文章列表惊喜红包任务
                        if (taskList[index]['type'] == 6 && taskList[index]['channelType'].indexOf(1) != -1 && taskList[index]['actionType'] == 16) {

                            // 文章列表惊喜红包任务
                            if (taskList[index].showTask) {

                                if (taskList[index].page == page) {

                                    if (taskList[index].getAward) {
                                        return false;
                                    }

                                    return taskList[index];
                                } else {
                                    return false;
                                }

                            }
                        }
                    }

                    for (var index in taskList) {

                        // 文章列表惊喜红包任务
                        if (taskList[index]['type'] == 6 && taskList[index]['channelType'].indexOf(1) != -1 && taskList[index]['actionType'] == 16) {

                            // 概率出现发现任务
                            var random = Math.floor(Math.random() * 100);
                            if (random < taskList[index]['conditionNumber']) {

                                taskList[index].page = page;
                                taskList[index].showTask = 1;
                                FPHDSdk.addSessionStorage("FPHDTaskSdkTaskList", JSON.stringify(taskList));

                                doingTaskList[taskList[index].id] = taskList[index];

                                taskList[index].number += 1;
                                return taskList[index];
                            }

                        }
                    }

                    return false;
                },

                isHaveTask: function isHaveTask(channelType, actionType, type, newsId) {
                    var nowDate = FPHDTaskSdk._getNowYearMonthDate();

                    // 处理跨天的情况
                    if (initTaskListDate && nowDate != initTaskListDate) {
                        FPHDTaskSdk.getTaskList(channelType, actionType, type, newsId);
                        return false;
                    }

                    // 暂时对游戏相关任务做特殊处理
                    if (type == 3) {
                        FPHDTaskSdk._initApi();
                    }

                    if (!channelType || !actionType || !type) {
                        return false;
                    }

                    channelType = parseInt(channelType);
                    actionType = parseInt(actionType);
                    type = parseInt(type);
                    newsId = newsId ? parseInt(newsId) : 0;
                    var taskListJsonStr = FPHDSdk.getSessionStorage("FPHDTaskSdkTaskList");
                    if (FPHDSdk.dataIsNull(taskListJsonStr)) {
                        return false;
                    }

                    var taskList = JSON.parse(taskListJsonStr);
                    if (FPHDSdk.dataIsNull(taskList)) {
                        return false;
                    }

                    var haveTask = false;
                    for (var index in taskList) {

                        if (taskList[index]['type'] == type && taskList[index]['channelType'].indexOf(channelType) != -1 && taskList[index]['actionType'] == actionType) {

                            var nowTask = taskList[index];

                            // 同一篇文章或视频领取过奖励就不再触发
                            if (newsId && nowTask['overTask'] && !FPHDSdk.dataIsNull(nowTask['overTask'][newsId])) {
                                continue;
                            }

                            // 文章列表发现任务
                            if (nowTask['type'] == 5) {

                                // 阅读文章
                                if (channelType == 1 && newsId && nowTask.newsId == newsId) {
                                    haveTask = true;
                                    doingTaskList[nowTask.id] = nowTask;
                                }

                                // 观看视频
                                if (channelType == 2) {

                                    // 视频发现任务
                                    if (nowTask.newsId) {

                                        if (newsId == nowTask.newsId) {
                                            haveTask = true;
                                            doingTaskList[nowTask.id] = nowTask;
                                        }

                                    } else {
                                        // 50%概率出现发现任务
                                        var random = Math.floor(Math.random() * 100);
                                        if (random < nowTask['rate']) {
                                            taskList[index].newsId = newsId;
                                            FPHDSdk.addSessionStorage("FPHDTaskSdkTaskList", JSON.stringify(taskList));

                                            haveTask = true;
                                            nowTask.newsId = newsId;
                                            doingTaskList[nowTask.id] = nowTask;
                                        }
                                    }

                                }

                                // 惊喜红包任务
                            } else if (nowTask['type'] == 6) {

                                // 视频惊喜红包，视频红包会相隔多少个视频出现
                                if (channelType == 2) {

                                    var haveVideoHongbao = false;
                                    if (!nowTask.newsId) {
                                        nowTask.newsId = newsId;
                                        nowTask.index = 0;

                                        haveVideoHongbao = true;
                                    } else if (nowTask.newsId && nowTask.newsId != newsId) {
                                        nowTask.index += 1;

                                        if (nowTask.index == nowTask.conditionNumber) {
                                            nowTask.newsId = newsId;
                                            nowTask.index = 0;

                                            haveVideoHongbao = true;
                                        } else {
                                            doingTaskList[nowTask.id] = nowTask;

                                            taskList[index] = nowTask;
                                            FPHDSdk.addSessionStorage("FPHDTaskSdkTaskList", JSON.stringify(taskList));
                                        }
                                    }

                                    if (haveVideoHongbao) {
                                        doingTaskList[nowTask.id] = nowTask;

                                        taskList[index] = nowTask;
                                        FPHDSdk.addSessionStorage("FPHDTaskSdkTaskList", JSON.stringify(taskList));
                                        FPHDTaskSdk._videoSurpriseHongbao();
                                    }
                                }

                                // 福利任务
                            } else if (nowTask['type'] == 3) {

                                if (nowTask.gameId == newsId) {
                                    haveTask = true;
                                    doingTaskList[nowTask.id] = nowTask;
                                }

                                // 计时任务
                            } else if (nowTask['type'] == 4) {

                                haveTask = true;
                                nowTask.newsId = newsId;
                                doingTaskList[nowTask.id] = nowTask;

                                taskList[index] = nowTask;
                                FPHDSdk.addSessionStorage("FPHDTaskSdkTaskList", JSON.stringify(taskList));

                            } else {


                                if (newsId) {

                                    var nowHavetask = false;
                                    if (!nowTask.newsId) {
                                        nowTask.newsId = newsId;
                                        nowHavetask = true;
                                    } else if (nowTask.newsId && nowTask.newsId != newsId) {
                                        nowTask.newsId = newsId;
                                        nowHavetask = true;
                                    }

                                    if (nowHavetask) {
                                        haveTask = true;
                                        doingTaskList[nowTask.id] = nowTask;

                                        taskList[index] = nowTask;
                                        FPHDSdk.addSessionStorage("FPHDTaskSdkTaskList", JSON.stringify(taskList));
                                    }

                                } else {
                                    haveTask = true;
                                    doingTaskList[nowTask.id] = nowTask;
                                }

                            }

                        }
                    }

                    console.log('isHaveTask', channelType, actionType, type, newsId, doingTaskList);

                    return haveTask;
                },

                doTask: function doTask(channelType, actionType, type, newsId, callback) {
                    // 初始化接口域名
                    FPHDTaskSdk._initApi();
                    if (!taskApiServerUrl) {
                        return;
                    }
                    if (!channelType || !actionType || !type) {
                        return false;
                    }

                    if (callback) {
                        taskCallback = callback;
                    }

                    channelType = parseInt(channelType);
                    actionType = parseInt(actionType);
                    type = parseInt(type);
                    newsId = newsId ? parseInt(newsId) : 0;
                    var taskListJsonStr = FPHDSdk.getSessionStorage("FPHDTaskSdkTaskList");
                    if (FPHDSdk.dataIsNull(taskListJsonStr)) {
                        return false;
                    }

                    var taskList = JSON.parse(taskListJsonStr);
                    if (FPHDSdk.dataIsNull(taskList)) {
                        return false;
                    }

                    console.log('doTask', channelType, actionType, type, newsId, callback, doingTaskList);

                    for (var index in doingTaskList) {
                        if (doingTaskList[index]['type'] == type && doingTaskList[index]['channelType'].indexOf(channelType) != -1 && doingTaskList[index]['actionType'] == actionType) {

                            var nowTask = doingTaskList[index];

                            // 同一篇文章或视频领取过奖励就不再触发
                            if (newsId && nowTask['overTask'] && !FPHDSdk.dataIsNull(nowTask['overTask'][newsId])) {
                                continue;
                            }

                            // 日常任务
                            var types = [1, 9, 10, 11, 12];
                            if (types.indexOf(type) !== 1) {

                                // 阅读文章
                                if (channelType == 1 && actionType == 1) {
                                    // 监控屏幕触摸事件
                                    FPHDTaskSdk.listenerReadArticle(nowTask);

                                    // 记录文章的高度，用于后端检测是否做完任务，页面渲染需要延时才能获取到文章内容高度
                                    setTimeout(function () {
                                        var articleContainerObj = document.getElementById("articleContainer");
                                        containsHeight = articleContainerObj.scrollHeight - FPHDSdk.getHeight();
                                        FPHDTaskSdk._sendStartTask(nowTask, containsHeight);
                                    }, 1000);

                                    // 监控视频观看任务
                                } else if (channelType == 2 && actionType == 1) {

                                    // 视频能一直滑动，需要先清除之前的重新计算
                                    clearTimeout(videoSetTimeoutId);

                                    FPHDTaskSdk._sendStartTask(nowTask);
                                    videoSetTimeoutId = setTimeout(function () {
                                        FPHDTaskSdk._sendDoTask(nowTask);
                                    }, nowTask['conditionNumber'] * 1000);
                                } else {
                                    FPHDTaskSdk._sendDoTask(nowTask, channelType);
                                }

                            }

                            // 红包任务
                            if (nowTask['type'] == 2) {
                                FPHDTaskSdk._sendDoTask(nowTask);
                            }

                            // 福利任务
                            if (nowTask['type'] == 3) {

                                if (nowTask.gameId == newsId) {
                                    FPHDTaskSdk._createTimer(nowTask);
                                }
                            }

                            // 计时任务
                            if (nowTask['type'] == 4) {

                                // 阅读文章
                                if (channelType == 1 && nowTask['channelType'].indexOf(1) != -1 && nowTask['actionType'] == 1) {
                                    FPHDTaskSdk.listenerReadArticle(nowTask);
                                    FPHDTaskSdk._sendStartTask(nowTask);
                                }

                                // 观看视频
                                if (channelType == 2 && nowTask['channelType'].indexOf(2) != -1 && nowTask['actionType'] == 1) {

                                    // videoTimePassTime = 0;
                                    isStartVideoTimingTask = true;

                                    FPHDTaskSdk._createTimer(nowTask, 2);
                                    FPHDTaskSdk._sendStartTask(nowTask);
                                }
                            }

                            // 发现任务
                            if (nowTask['type'] == 5) {

                                // 阅读文章
                                if (channelType == 1 && nowTask['channelType'].indexOf(1) != -1 && nowTask['actionType'] == 1 && taskList[index].newsId && taskList[index].newsId == newsId) {

                                    if (!nowTask['getAward']) {
                                        nowTask['getAward'] = 1;

                                        FPHDTaskSdk.listenerReadArticle(nowTask);
                                        FPHDTaskSdk._sendStartTask(nowTask);
                                    }

                                }

                                // 观看视频
                                if (channelType == 2 && nowTask['channelType'].indexOf(2) != -1 && nowTask['actionType'] == 1) {
                                    isStartTiming = true;
                                    FPHDTaskSdk._createTimer(nowTask);
                                    FPHDTaskSdk._sendStartTask(nowTask);
                                }
                            }

                            // 惊喜红包
                            if (nowTask['type'] == 6) {

                                // 推荐列表
                                if (channelType == 1 && nowTask['channelType'].indexOf(1) != -1 && nowTask['actionType'] == 16 && nowTask['showTask']) {

                                    if (!nowTask['getAward']) {
                                        nowTask['getAward'] = 1;

                                        FPHDTaskSdk._sendDoTask(nowTask, channelType);
                                    }

                                }

                                // 视频惊喜红包
                                if (channelType == 2 && nowTask['channelType'].indexOf(2) != -1 && nowTask['actionType'] == 16) {
                                    FPHDTaskSdk._sendDoTask(nowTask, channelType);
                                }
                            }

                            // 小区群任务
                            if (nowTask['type'] == 7) {
                                FPHDTaskSdk._sendDoTask(nowTask);
                            }

                            // 新手任务
                            if (nowTask['type'] == 9) {
                                // 签到
                                if (channelType == 12 && nowTask['actionType'] == 17) {
                                    FPHDTaskSdk._sendDoTask(nowTask);
                                }
                                // 阅读文章
                                if (channelType == 1 && actionType == 1) {
                                    // 监控屏幕触摸事件
                                    FPHDTaskSdk.listenerReadArticle(nowTask);

                                    // 记录文章的高度，用于后端检测是否做完任务，页面渲染需要延时才能获取到文章内容高度
                                    setTimeout(function () {
                                        var articleContainerObj = document.getElementById("articleContainer");
                                        containsHeight = articleContainerObj.scrollHeight - FPHDSdk.getHeight();
                                        FPHDTaskSdk._sendStartTask(nowTask, containsHeight);
                                    }, 1000);

                                    // 监控视频观看任务
                                } else if (channelType == 2 && actionType == 1) {

                                    // 视频能一直滑动，需要先清除之前的重新计算
                                    clearTimeout(videoSetTimeoutId);

                                    FPHDTaskSdk._sendStartTask(nowTask);
                                    videoSetTimeoutId = setTimeout(function () {
                                        FPHDTaskSdk._sendDoTask(nowTask);
                                    }, nowTask['conditionNumber'] * 1000);
                                } else {
                                    FPHDTaskSdk._sendDoTask(nowTask, channelType);
                                }
                            }

                            break;
                        }
                    }

                },

                // 监听阅读文章触摸事件
                listenerReadArticle: function listenerReadArticle(taskInfo) {

                    if (!taskInfo) {
                        return;
                    }

                    var touchObj = document.getElementById("commentScroll");

                    // 不在文章详情页则不执行
                    if (!touchObj) {
                        return;
                    }

                    if (!isStartRecord) {
                        // 添加触摸事件监听
                        if (FPHDSdk.getSystemType() == 'web') {
                            touchObj.addEventListener("mousedown", FPHDTaskSdk._touchReadArticleStart, false);
                            touchObj.addEventListener("mousemove", FPHDTaskSdk._touchReadArticleMove, false);
                            touchObj.addEventListener("mouseup", FPHDTaskSdk._touchReadArticleEnd, false);
                            touchObj.addEventListener("mouseout", FPHDTaskSdk._touchReadArticleEnd, false);
                        } else {
                            touchObj.addEventListener("touchstart", FPHDTaskSdk._touchReadArticleStart, false);
                            touchObj.addEventListener("touchmove", FPHDTaskSdk._touchReadArticleMove, false);
                            touchObj.addEventListener("touchend", FPHDTaskSdk._touchReadArticleEnd, false);
                        }
                    }

                    startScrollTop = 0;
                    readTime = 0;
                    lastTime = new Date().getTime();
                    lastTouchTime = new Date().getTime();
                    isStartRecord = true;
                    isStartTiming = true;

                    FPHDTaskSdk._createTimer(taskInfo, 1);
                },

                // 创建定时器
                _createTimer: function _createTimer(taskInfo, channelType) {

                    // 计时任务需要创建计时器
                    if (taskInfo['type'] == 4) {

                        // 存在菜单则不创建计时任务的计时圈
                        var eggDocumentObj = document.getElementById('circle-bar-award-timing-egg');
                        if (eggDocumentObj) {
                            return;
                        }

                        // 视频的计时转圈是按时间来计算
                        var bottomCss = '';
                        if (channelType == 2 && taskInfo['channelType'].indexOf(2) != -1) {
                            bottomCss = 'bottom: 3rem;';
                        }

                        var html = '<div class="circle-bar" id="circle-bar-timing" style="font-size: 1rem;width: 1rem;height:1rem;position:absolute;right: 0.2rem;background-color: #FFC23B;border-radius: 50%;float: right;box-shadow: 0 0 8px #898989;' + bottomCss + '">' +
                            '    <div id="circle-bar-award-timing"></div>' +
                            '    <div class="circle-bar-left" id="circle-bar-left-timing" style="width: 1rem;height: 1rem;background-color: #FFFFFF;clip: rect(0, .5em, auto, 0);position: absolute;top: 0;right: 0;bottom: 0;left: 0;margin: auto;border-radius: 50%;"></div>' +
                            '    <div class="circle-bar-right" id="circle-bar-right-timing" style="width: 1rem;height: 1rem;background-color: #FFFFFF;clip: rect(0, auto, auto, .5em);position: absolute;top: 0;right: 0;bottom: 0;left: 0;margin: auto;border-radius: 50%;"></div>' +
                            '    <div class="mask" style="width: 0.85rem;height: 0.85rem;background-color: #fff;text-align: center;line-height: 0.2rem;color: rgba(0, 0, 0, 0.5);position: absolute;top: 0;right: 0;bottom: 0;left: 0;margin: auto;border-radius: 50%;">' +
                            '        <img src="/task/hongbao1.png" style="width: 85%;height: 85%;position: absolute;top: 0;right: 0;bottom: 0;left: 0;margin: auto;border-radius: 50%;">' +
                            '    </div>' +
                            '</div>';

                        var documentObj = document.getElementById('FPHDTaskTimingTask');
                        if (!FPHDSdk.dataIsNull(documentObj)) {
                            documentObj.innerHTML = '';
                        } else {
                            var fphdDiv = document.createElement("fphdtaskdiv");
                            fphdDiv.id = 'FPHDTaskTimingTask';
                            fphdDiv.style.position = "fixed";
                            fphdDiv.style.zIndex = "9990";
                            fphdDiv.style.bottom = "2.8rem";
                            fphdDiv.style.right = "0";
                            document.body.appendChild(fphdDiv);
                        }
                        document.getElementById('FPHDTaskTimingTask').innerHTML = html;

                        if (channelType == 1) {
                            // 开始计算圈数
                            // timingTaskPassTime = 0;
                            var timingTaskPassTimeKey = FPHDTaskSdk._getNowYearMonthDate() + '_timingTaskPassTime';
                            timingTaskPassTime = FPHDSdk.getCookie(timingTaskPassTimeKey) ? parseInt(FPHDSdk.getCookie(timingTaskPassTimeKey)) : 0;
                            var timingBarRightObj = document.getElementById("circle-bar-right-timing");
                            var timingBarLeftObj = document.getElementById("circle-bar-left-timing");
                            var percent = parseInt(timingTaskPassTime);
                            if (percent != 0) {
                                if (percent >= 100) {
                                    FPHDTaskSdk._sendDoTask(taskInfo, 1);
                                    timingTaskPassTime -= 100;
                                    timingBarLeftObj.style.transform = 'rotate(0deg)';
                                    timingBarLeftObj.style.backgroundColor = '#FFFFFF';
                                    timingBarRightObj.style.transform = 'rotate(0deg)';
                                    timingBarRightObj.style.backgroundColor = '#FFFFFF';
                                }
                                if (percent <= 50) {
                                    timingBarRightObj.style.transform = 'rotate(' + (percent * 3.6) + 'deg)';
                                } else {
                                    timingBarRightObj.style.transform = 'rotate(0deg)';
                                    timingBarRightObj.style.backgroundColor = '#FFC23B';
                                    timingBarLeftObj.style.transform = 'rotate(' + ((percent - 50) * 3.6) + 'deg)'
                                }
                            }

                            // 文章打开时默认增加12度
                            FPHDTaskSdk._timingTaskPassAnimation(taskInfo, 12);
                        }

                        // 视频的计时转圈是按时间来计算
                        if (channelType == 2 && taskInfo['channelType'].indexOf(2) != -1) {
                            var timingBarRightObj = document.getElementById("circle-bar-right-timing");
                            var timingBarLeftObj = document.getElementById("circle-bar-left-timing");
                            videoTimePassTime = parseInt((videoTimePassPercent / 100) * taskInfo['conditionNumber']);
                            console.log('videoTimePassTime', videoTimePassTime, 'videoTimePassPercent', videoTimePassPercent);
                            // 调整进度条
                            if (videoTimePassPercent <= 50) {
                                timingBarRightObj.style.transform = 'rotate(' + (videoTimePassPercent * 3.6) + 'deg)';
                            } else {
                                timingBarRightObj.style.transform = 'rotate(0deg)';
                                timingBarRightObj.style.backgroundColor = '#FFC23B';
                                timingBarLeftObj.style.transform = 'rotate(' + ((videoTimePassPercent - 50) * 3.6) + 'deg)'
                            }
                            FPHDTaskSdk._videoTimeProgressBar(taskInfo);
                        }
                    }

                    // 发现任务需要创建固定的时间计时器
                    if (taskInfo['type'] == 5) {

                        var tipsText = '';
                        if (taskInfo['channelType'].indexOf(1) != -1) {
                            tipsText = '阅读文章，完成计时就可获得额外奖励';
                        } else if (taskInfo['channelType'].indexOf(2) != -1) {
                            tipsText = '观看视频，完成计时就可获得额外奖励';
                        }

                        var html = '<div style="position: relative;width: 2.75rem;float: left;right: 1.3rem;top: 2rem;" id="circle-tips">' +
                            '    <p style="width: 0px;height: 0px;border-top: 0.1rem solid transparent;border-left: 0.2rem solid rgba(0, 0, 0, 0.5);border-right: 0.2rem solid transparent;border-bottom: 0.1rem solid transparent;position: absolute;right: -0.1rem;top: 0.2rem;"></p>' +
                            '    <p style="width: 2.45rem;font-size: 0.235rem;color: #ffffff;background: rgba(0, 0, 0, 0.5);padding:5px;border-radius: 6px;">' + tipsText + '</p>' +
                            '</div>' +
                            '<div class="circle-bar" id="circle-bar-find" style="font-size: 1rem;width: 1rem;height:1rem;position:absolute;right: 0.2rem;top: 2rem;background-color: #FFC23B;border-radius: 50%;float: right;box-shadow: 0 0 8px #898989;">' +
                            '    <div id="circle-bar-award-find"></div>' +
                            '    <div class="circle-bar-left" id="circle-bar-left-find" style="width: 1rem;height: 1rem;background-color: #FFFFFF;clip: rect(0, .5em, auto, 0);position: absolute;top: 0;right: 0;bottom: 0;left: 0;margin: auto;border-radius: 50%;"></div>' +
                            '    <div class="circle-bar-right" id="circle-bar-right-find" style="width: 1rem;height: 1rem;background-color: #FFFFFF;clip: rect(0, auto, auto, .5em);position: absolute;top: 0;right: 0;bottom: 0;left: 0;margin: auto;border-radius: 50%;"></div>' +
                            '    <div class="mask" style="width: 0.85rem;height: 0.85rem;background-color: #fff;text-align: center;line-height: 0.2rem;color: rgba(0, 0, 0, 0.5);position: absolute;top: 0;right: 0;bottom: 0;left: 0;margin: auto;border-radius: 50%;">' +
                            '        <img src="/task/hongbao3.png" style="width: 85%;height: 85%;position: absolute;top: 0;right: 0;bottom: 0;left: 0;margin: auto;border-radius: 50%;">' +
                            '        <div style="font-size: 0.21rem;color: #AA3D15;position: absolute;font-weight: bold;margin-top: 40%;margin-left: 34%;">' + taskInfo['taskAwardNumber'] + '</div>' +
                            '    </div>' +
                            '</div>';

                        var documentObj = document.getElementById('FPHDTaskFindTask');
                        if (!FPHDSdk.dataIsNull(documentObj)) {
                            documentObj.innerHTML = '';
                        } else {
                            var fphdDiv = document.createElement("fphdtaskdiv");
                            fphdDiv.id = 'FPHDTaskFindTask';
                            fphdDiv.style.position = "fixed";
                            fphdDiv.style.zIndex = "9990";
                            fphdDiv.style.top = "0";
                            fphdDiv.style.right = "0";
                            document.body.appendChild(fphdDiv);
                        }
                        document.getElementById('FPHDTaskFindTask').innerHTML = html;

                        setTimeout(function () {
                            var documentObj = document.getElementById('circle-tips');
                            if (!FPHDSdk.dataIsNull(documentObj)) {
                                documentObj.innerHTML = '';
                            }
                        }, 5000);

                        // 开始计时
                        fixedTimePassTime = 0;
                        FPHDTaskSdk._fixedTimeProgressBar(taskInfo, channelType);
                    }

                    // 福利任务中游戏需要创建固定的时间计时器
                    if (taskInfo['type'] == 3) {

                        var tipsText = '登录游戏，完成计时就可获得额外奖励';

                        var html = '<div style="position: relative;width: 6.75rem;float: left;right: 5.8rem;bottom: 6rem;" id="circle-tips">' +
                            '    <p style="width: 0px;height: 0px;border-top: 0.3rem solid transparent;border-left: 0.6rem solid rgba(0, 0, 0, 0.5);border-right: 0.6rem solid transparent;border-bottom: 0.3rem solid transparent;position: absolute;right: -1.92rem;top: 0.2rem;"></p>' +
                            '    <p style="width: 6.85rem;font-size: 0.235rem;color: #ffffff;background: rgba(0, 0, 0, 0.5);padding:5px;border-radius: 6px;">' + tipsText + '</p>' +
                            '</div>' +
                            '<div class="circle-bar" id="circle-bar-game" style="font-size: 3rem;width: 3rem;height:3rem;position:absolute;right: 0.6rem;top: 6rem;background-color: #FFC23B;border-radius: 50%;float: right;box-shadow: 0 0 8px #898989;">' +
                            '    <div id="circle-bar-award-find"></div>' +
                            '    <div class="circle-bar-left" id="circle-bar-left-game" style="width: 3rem;height: 3rem;background-color: #FFFFFF;clip: rect(0, 0.5em, auto, 0);position: absolute;top: 0;right: 0;bottom: 0;left: 0;margin: auto;border-radius: 50%;"></div>' +
                            '    <div class="circle-bar-right" id="circle-bar-right-game" style="width: 3rem;height: 3rem;background-color: #FFFFFF;clip: rect(0, auto, auto, 0.5em);position: absolute;top: 0;right: 0;bottom: 0;left: 0;margin: auto;border-radius: 50%;"></div>' +
                            '    <div class="mask" style="width: 2.55rem;height: 2.55rem;background-color: #fff;text-align: center;line-height: 0.2rem;color: rgba(0, 0, 0, 0.5);position: absolute;top: 0;right: 0;bottom: 0;left: 0;margin: auto;border-radius: 50%;">' +
                            '        <img src="/task/hongbao3.png" style="width: 85%;height: 85%;position: absolute;top: 0;right: 0;bottom: 0;left: 0;margin: auto;border-radius: 50%;">' +
                            '        <div style="font-size: 0.21rem;color: #AA3D15;position: absolute;font-weight: bold;left: 2%;width: 2.55rem;height: 2.55rem;line-height: 2.55rem;text-align: center;">' + taskInfo['taskAwardNumber'] + '</div>' +
                            '    </div>' +
                            '</div>';

                        var documentObj = document.getElementById('FPHDTaskWelfareTask');
                        if (!FPHDSdk.dataIsNull(documentObj)) {
                            documentObj.innerHTML = '';
                        } else {
                            var fphdDiv = document.createElement("fphdtaskdiv");
                            fphdDiv.id = 'FPHDTaskWelfareTask';
                            fphdDiv.style.position = "fixed";
                            fphdDiv.style.zIndex = "9990";
                            fphdDiv.style.top = "0";
                            fphdDiv.style.right = "0";
                            document.body.appendChild(fphdDiv);
                        }
                        document.getElementById('FPHDTaskWelfareTask').innerHTML = html;

                        setTimeout(function () {
                            var documentObj = document.getElementById('circle-tips');
                            if (!FPHDSdk.dataIsNull(documentObj)) {
                                documentObj.innerHTML = '';
                            }
                        }, 5000);

                        // 开始计时
                        gameWelfareTaskTimePassTime = 0;
                        FPHDTaskSdk._gameWelfareTaskTimeProgressBar(taskInfo);
                    }

                },

                // 文章计时器转动动画
                _timingTaskPassAnimation: function _timingTaskPassAnimation(taskInfo, degree) {
                    var timingBarRightObj = document.getElementById("circle-bar-right-timing");
                    var timingBarLeftObj = document.getElementById("circle-bar-left-timing");
                    var percent = timingTaskPassTime;
                    var startPercent = percent;
                    var tmpPercent = percent;
                    var finalPercent = percent + degree;
                    var stepPercent = parseFloat((finalPercent - startPercent) / 5);
                    var tmpInterval = setInterval(function () {
                        if (tmpPercent >= finalPercent) {
                            clearInterval(tmpInterval);
                        } else {
                            tmpPercent += stepPercent;
                            if (tmpPercent >= 100) {
                                FPHDTaskSdk._timingTaskComplete(taskInfo);
                                tmpPercent -= 100;
                                finalPercent -= 100;
                            }
                            if (tmpPercent <= 50) {
                                timingBarRightObj.style.transform = 'rotate(' + (tmpPercent * 3.6) + 'deg)';
                            } else {
                                timingBarRightObj.style.transform = 'rotate(0deg)';
                                timingBarRightObj.style.backgroundColor = '#FFC23B';
                                timingBarLeftObj.style.transform = 'rotate(' + ((tmpPercent - 50) * 3.6) + 'deg)'
                            }
                        }
                    }, 300);
                    timingTaskPassTime = finalPercent;
                    if (timingTaskPassTime >= 100) {
                        timingTaskPassTime -= 100;
                    }
                    var timingTaskPassTimeKey = FPHDTaskSdk._getNowYearMonthDate() + '_timingTaskPassTime';
                    FPHDSdk.delCookie(timingTaskPassTimeKey);
                    FPHDSdk.addCookie(timingTaskPassTimeKey, timingTaskPassTime);
                },

                // 文章计时器任务完成
                _timingTaskComplete: function _timingTaskComplete(taskInfo) {
                    var timingBarRightObj = document.getElementById("circle-bar-right-timing");
                    var timingBarLeftObj = document.getElementById("circle-bar-left-timing");
                    FPHDTaskSdk._sendDoTask(taskInfo, 1);
                    timingBarLeftObj.style.transform = 'rotate(0deg)';
                    timingBarLeftObj.style.backgroundColor = '#FFFFFF';
                    timingBarRightObj.style.transform = 'rotate(0deg)';
                    timingBarRightObj.style.backgroundColor = '#FFFFFF';
                },

                // 视频计算任务的时间计时器
                _videoTimeProgressBar: function _videoTimeProgressBar(taskInfo) {

                    var totalTime = taskInfo['conditionNumber'];
                    var timingBarRightObj = document.getElementById("circle-bar-right-timing");
                    var timingBarLeftObj = document.getElementById("circle-bar-left-timing");

                    if (timingBarRightObj && timingBarLeftObj) {

                        setTimeout(function () {
                            videoTimePassTime += 1;

                            videoTimePassPercent = parseInt((videoTimePassTime / totalTime) * 100); //当前的百分比数

                            // 调整进度条
                            if (videoTimePassPercent <= 50) {
                                timingBarRightObj.style.transform = 'rotate(' + (videoTimePassPercent * 3.6) + 'deg)';
                            } else {
                                timingBarRightObj.style.transform = 'rotate(0deg)';
                                timingBarRightObj.style.backgroundColor = '#FFC23B';
                                timingBarLeftObj.style.transform = 'rotate(' + ((videoTimePassPercent - 50) * 3.6) + 'deg)'
                            }

                            // 任务完成
                            if (videoTimePassPercent >= 100) {

                                videoTimePassTime = 0;
                                videoTimePassPercent = 0;

                                timingBarLeftObj.style.transform = 'rotate(0deg)';
                                timingBarLeftObj.style.backgroundColor = '#FFFFFF';
                                timingBarRightObj.style.transform = 'rotate(0deg)';
                                timingBarRightObj.style.backgroundColor = '#FFFFFF';

                                FPHDTaskSdk._sendDoTask(taskInfo, 2);
                            }

                            FPHDTaskSdk._videoTimeProgressBar(taskInfo);
                        }, 1000);
                    }

                },

                // 视频惊喜红包
                _videoSurpriseHongbao: function _videoSurpriseHongbao() {

                    var html = '<div onclick="FPHDTaskSdk.doTask(2, 16, 6);">' +
                        '    <img src="/task/shipinhongbao.png" alt="" style="width:0.725rem;height: 0.88rem;">' +
                        '</div>';

                    var documentObj = document.getElementById('FPHDTaskVideoSurpriseHongbao');
                    if (!FPHDSdk.dataIsNull(documentObj)) {
                        documentObj.innerHTML = '';
                    } else {
                        var fphdDiv = document.createElement("fphdtaskdiv");
                        fphdDiv.id = 'FPHDTaskVideoSurpriseHongbao';
                        fphdDiv.style.position = "fixed";
                        fphdDiv.style.zIndex = "9990";
                        fphdDiv.style.bottom = "3.5rem";
                        fphdDiv.style.left = "0.15rem";
                        document.body.appendChild(fphdDiv);
                    }
                    document.getElementById('FPHDTaskVideoSurpriseHongbao').innerHTML = html;
                },

                // 固定的时间计时器
                _fixedTimeProgressBar: function _fixedTimeProgressBar(taskInfo, channelType) {

                    // 停止阅读，计时任务需要停掉
                    if (!isStartTiming) {
                        return;
                    }

                    var totalTime = taskInfo['conditionNumber'];
                    var findBarRightObj = document.getElementById("circle-bar-right-find");
                    var findBarLeftObj = document.getElementById("circle-bar-left-find");

                    if (findBarRightObj && findBarLeftObj) {
                        setTimeout(function () {
                            fixedTimePassTime += 1;

                            var percent = parseInt((fixedTimePassTime / totalTime) * 100); //当前的百分比数

                            // 调整进度条
                            if (percent <= 50) {
                                findBarRightObj.style.transform = 'rotate(' + (percent * 3.6) + 'deg)';
                            } else {
                                findBarRightObj.style.transform = 'rotate(0deg)';
                                findBarRightObj.style.backgroundColor = '#FFC23B';
                                findBarLeftObj.style.transform = 'rotate(' + ((percent - 50) * 3.6) + 'deg)'
                            }

                            // 任务完成
                            if (fixedTimePassTime >= totalTime) {
                                FPHDTaskSdk._sendDoTask(taskInfo, channelType);
                                return;
                            }

                            FPHDTaskSdk._fixedTimeProgressBar(taskInfo, channelType);
                        }, 1000);
                    }

                },

                // 固定的时间计时器
                _gameWelfareTaskTimeProgressBar: function _gameWelfareTaskTimeProgressBar(taskInfo) {

                    // 离开游戏页面，计时任务需要停掉
                    var gameDocumentObj = document.getElementById('play-game-content');
                    if (!gameDocumentObj) {
                        return;
                    }

                    var totalTime = 30;
                    var gameWelfareTaskBarRightObj = document.getElementById("circle-bar-right-game");
                    var gameWelfareTaskBarLeftObj = document.getElementById("circle-bar-left-game");

                    if (gameWelfareTaskBarRightObj && gameWelfareTaskBarLeftObj) {
                        setTimeout(function () {
                            gameWelfareTaskTimePassTime += 1;

                            var percent = parseInt((gameWelfareTaskTimePassTime / totalTime) * 100); //当前的百分比数

                            // 调整进度条
                            if (percent <= 50) {
                                gameWelfareTaskBarRightObj.style.transform = 'rotate(' + (percent * 3.6) + 'deg)';
                            } else {
                                gameWelfareTaskBarRightObj.style.transform = 'rotate(0deg)';
                                gameWelfareTaskBarRightObj.style.backgroundColor = '#FFC23B';
                                gameWelfareTaskBarLeftObj.style.transform = 'rotate(' + ((percent - 50) * 3.6) + 'deg)'
                            }

                            // 任务完成
                            if (gameWelfareTaskTimePassTime >= totalTime) {
                                FPHDTaskSdk._sendDoTask(taskInfo);
                                return;
                            }

                            FPHDTaskSdk._gameWelfareTaskTimeProgressBar(taskInfo);
                        }, 1000);
                    }

                },

                // 开始触摸
                _touchReadArticleStart: function _touchReadArticleStart(event) {
                    // 对pc端和手机端做特殊处理
                    if (FPHDSdk.getSystemType() == 'web') {
                        var touch = event;
                    } else {
                        var touch = event.changedTouches[0];
                    }

                    startTouchTime = new Date().getTime();
                },

                // 滑动
                _touchReadArticleMove: function _touchReadArticleMove(event) {

                    // 对pc端和手机端做特殊处理
                    if (FPHDSdk.getSystemType() == 'web') {
                        var touch = event;
                    } else {
                        var touch = event.changedTouches[0];
                    }

                },

                // 触摸结束
                _touchReadArticleEnd: function _touchReadArticleEnd(event) {

                    // 对pc端和手机端做特殊处理
                    if (FPHDSdk.getSystemType() == 'web') {
                        var touch = event;
                    } else {
                        var touch = event.changedTouches[0];
                    }

                    var nowTime = new Date().getTime();
                    var readTime = parseInt((nowTime - lastTime) / 1000);

                    // 获取当前滚动的高度
                    var scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop;
                    for (var taskId in doingTaskList) {

                        if (isStartRecord) {
                            // 处理日常任务里面的阅读文章任务
                            if (doingTaskList[taskId]['channelType'].indexOf(1) != -1 && doingTaskList[taskId]['actionType'] == 1) {

                                var articleContainerObj = document.getElementById("articleContainer");
                                containsHeight = articleContainerObj.scrollHeight - FPHDSdk.getHeight();

                                // 滚动的距离大于等于文章总距离认为文章已经读完
                                if (scrollTop < containsHeight) {
                                    continue;
                                }

                                // 文章最少要阅读20秒
                                if (readTime > 20) {
                                    FPHDTaskSdk._sendDoTask(doingTaskList[taskId]);
                                }
                            }
                        }

                        // 处理计时任务里面的阅读文章任务
                        var scrollTopHeight = scrollTop - startScrollTop;
                        if (doingTaskList[taskId]['type'] == 4 && doingTaskList[taskId]['channelType'].indexOf(1) != -1 && doingTaskList[taskId]['actionType'] == 1 && scrollTopHeight > 0) {

                            // 记录下次开始滚动的高度
                            startScrollTop = scrollTop;

                            // 两次触摸时间间隔大于3秒按3秒算，避免挂机情况
                            var touchSpaceTime = nowTime - lastTouchTime;// 这里是毫秒

                            // 挂机按 3 秒计算
                            if (touchSpaceTime > 2000) {
                                touchSpaceTime = 2000;
                            }

                            // 转动
                            var degree = parseInt((touchSpaceTime / (doingTaskList[taskId]['conditionNumber'] * 1000)) * 100);
                            FPHDTaskSdk._timingTaskPassAnimation(doingTaskList[taskId], degree);
                        }

                    }

                    // 记录触摸时间
                    lastTouchTime = nowTime;
                },

                _sendStartTask: function _sendStartTask(taskInfo, initValue) {
                    console.log('_sendStartTask', taskInfo, doingTaskList);
                    if (!taskInfo) {
                        return;
                    }

                    initValue = initValue ? initValue : 0;
                    var data = {taskInfo: taskInfo, initValue: initValue};
                    requestStartTaskList[taskInfo.id] = data;

                    setTimeout(function () {

                        if (FPHDSdk.dataIsNull(requestStartTaskList)) {
                            return;
                        }

                        if (!startRequestStartTask) {
                            startRequestStartTask = 1;
                            FPHDTaskSdk._mergeRequestStartTask();
                        }
                    }, 1000);

                },

                _sendDoTask: function _sendDoTask(taskInfo, channelType) {
                    console.trace();
                    if (!taskInfo) {
                        return;
                    }

                    // 后端记录同一篇文章或视频的id
                    if (doingTaskList[taskInfo['id']] && doingTaskList[taskInfo['id']].newsId) {
                        taskInfo.newsId = doingTaskList[taskInfo['id']].newsId;
                    }

                    channelType = channelType ? channelType : 0;
                    var data = {taskInfo: taskInfo, channelType: channelType};
                    requestDoTaskList[taskInfo.id] = data;

                    setTimeout(function () {

                        if (FPHDSdk.dataIsNull(requestDoTaskList)) {
                            return;
                        }

                        if (!startRequestDoTask) {
                            startRequestDoTask = 1;
                            FPHDTaskSdk._mergeRequestDoTask();
                        }
                    }, 1000);

                },

                _mergeRequestStartTask: function _mergeRequestStartTask() {

                    if (FPHDSdk.dataIsNull(requestStartTaskList)) {
                        return;
                    }

                    var taskData = {};
                    for (var i in requestStartTaskList) {
                        var taskId = requestStartTaskList[i]['taskInfo'].id;
                        var initValue = requestStartTaskList[i].initValue ? requestStartTaskList[i].initValue : 0;
                        taskData[taskId] = {};
                        taskData[taskId]['id'] = taskId;
                        taskData[taskId]['initValue'] = initValue;
                    }

                    var FPHDSdkUserInfo = FPHDSdk.getCookie('FPHDSdkUserInfo');
                    FPHDSdkUserInfo = decodeURIComponent(FPHDSdkUserInfo);
                    var FPHDSdkUserInfos = FPHDSdkUserInfo.split("||");

                    var postUrl = taskApiServerUrl + "/task/startTask?taskList=" + JSON.stringify(taskData) + "&sign=" + FPHDSdkUserInfos[0] + "&time=" + FPHDSdkUserInfos[1] + "&token=" + FPHDSdkUserInfos[3];
                    FPHDSdk.doGet({
                        url: postUrl,
                        onSuccess: function (data) {
                            requestStartTaskList = {};
                            startRequestStartTask = 0;
                        },
                        onFail: function () {

                        }
                    });

                },

                _mergeRequestDoTask: function _mergeRequestDoTask() {
                    console.log('requestDoTaskList', requestDoTaskList);
                    if (FPHDSdk.dataIsNull(requestDoTaskList)) {
                        return;
                    }

                    var channelType = 0;
                    var taskData = {};
                    for (var i in requestDoTaskList) {
                        var taskId = requestDoTaskList[i]['taskInfo'].id;
                        var newsId = requestDoTaskList[i]['taskInfo'].newsId ? requestDoTaskList[i]['taskInfo'].newsId : 0;
                        taskData[taskId] = {};
                        taskData[taskId]['id'] = taskId;
                        taskData[taskId]['newsId'] = newsId;
                        taskData[taskId]['clientChannelType'] = requestDoTaskList[i].channelType;

                        channelType = requestDoTaskList[i].channelType;
                    }

                    var FPHDSdkUserInfo = FPHDSdk.getCookie('FPHDSdkUserInfo');
                    FPHDSdkUserInfo = decodeURIComponent(FPHDSdkUserInfo);
                    var FPHDSdkUserInfos = FPHDSdkUserInfo.split("||");

                    var postUrl = taskApiServerUrl + "/task/doTask?taskList=" + JSON.stringify(taskData) + "&sign=" + FPHDSdkUserInfos[0] + "&time=" + FPHDSdkUserInfos[1] + "&token=" + FPHDSdkUserInfos[3];
                    FPHDSdk.doGet({
                        url: postUrl,
                        onSuccess: function (data) {

                            requestDoTaskList = {};
                            startRequestDoTask = 0;

                            var dataObj = eval("(" + data.response + ")");//转换为json对象
                            if (dataObj.code === 0) {

                                // 已经完成的任务处理
                                var overTaskList = dataObj.data.overTaskList;
                                if (FPHDSdk.dataIsNull(overTaskList) === false) {

                                    // 多个奖励一起获得显示混合奖励弹窗
                                    var isShowMixTips = false;
                                    /*
                                    if (document.getElementById('FPHDTaskMixTipsMessage')) {
                                        isShowMixTips = true;
                                    }
                                    // */
                                    if (overTaskList.length > 1) {
                                        isShowMixTips = true;
                                    }

                                    for (var i = 0; i < overTaskList.length; i++) {

                                        if (doingTaskList[overTaskList[i].id] && overTaskList[i].isOver) {
                                            delete doingTaskList[overTaskList[i].id];
                                        }

                                        // 记录阅读文章任务已经领过的文章id或者观看视频任务已经领过的视频id
                                        if (doingTaskList[overTaskList[i].id] && doingTaskList[overTaskList[i].id].newsId) {
                                            if (FPHDSdk.dataIsNull(doingTaskList[overTaskList[i].id].overTask)) {
                                                doingTaskList[overTaskList[i].id].overTask = {};
                                            }

                                            doingTaskList[overTaskList[i].id].overTask[doingTaskList[overTaskList[i].id].newsId] = doingTaskList[overTaskList[i].id].newsId;
                                        }

                                        // 完成平台任务或者完成小区群任务(分享不显示分享奖励)的结果提示
                                        if (overTaskList[i].type != 7 || (overTaskList[i].type == 7 && overTaskList[i].actionType != 14)) {

                                            // 推荐列表红包任务
                                            if (overTaskList[i].type == 6 && channelType == 1 && overTaskList[i]['channelType'].indexOf(1) != -1 && overTaskList[i]['actionType'] == 16) {

                                                FPHDTaskSdk._showAwardModal(dataObj.data);

                                                // 打开推荐列表红包回调业务调用层
                                                if (taskCallback) {
                                                    taskCallback({isShow: false});
                                                }
                                            } else {

                                                // 阅读文章发现任务回调业务调用层
                                                if (overTaskList[i].type == 5 && channelType == 1 && overTaskList[i]['actionType'] == 1) {

                                                    if (!FPHDSdk.dataIsNull(doingTaskList[overTaskList[i].id].newsId)) {
                                                        delete doingTaskList[overTaskList[i].id].newsId;
                                                    }

                                                    if (taskCallback) {
                                                        taskCallback({isShow: false});
                                                    }
                                                }

                                                // 多个奖励一起获得显示混合奖励弹窗
                                                if (!isShowMixTips) {
                                                    if (overTaskList[i].type != 7) {
                                                        // 视频惊喜红包，需要提示下一个红包什么时候可以领取
                                                        if (overTaskList[i].type == 6 && channelType == 2) {
                                                            FPHDTaskSdk._showTipsMessage(overTaskList[i], channelType, dataObj.data.list[overTaskList[i].id]);
                                                        } else {
                                                            FPHDTaskSdk._showTipsMessage(overTaskList[i], channelType);
                                                        }
                                                    } else {
                                                        isShowMixTips = true;
                                                    }
                                                }

                                                if (overTaskList[i].type == 5) {
                                                    isStartTiming = false;
                                                }

                                                if (overTaskList[i].type == 1) {
                                                    isStartRecord = false;
                                                }
                                            }
                                        }

                                    }

                                    // 多个奖励一起获得显示混合奖励弹窗
                                    if (isShowMixTips) {
                                        FPHDTaskSdk._showMixTipsMessage(overTaskList, channelType);
                                    }
                                }

                                // 记录当前看的文章（视频）id
                                for (var taskId in doingTaskList) {

                                    if (!FPHDSdk.dataIsNull(doingTaskList[taskId].newsId) && dataObj.data.list[taskId]) {
                                        dataObj.data.list[taskId].newsId = doingTaskList[taskId].newsId;
                                    }

                                    if ((doingTaskList[taskId].index === 0 || !FPHDSdk.dataIsNull(doingTaskList[taskId].index)) && dataObj.data.list[taskId]) {
                                        dataObj.data.list[taskId].index = doingTaskList[taskId].index;
                                    }

                                    if (!FPHDSdk.dataIsNull(doingTaskList[taskId].overTask) && dataObj.data.list[taskId]) {
                                        dataObj.data.list[taskId].overTask = doingTaskList[taskId].overTask;
                                    }
                                }

                                // 更新前端存储的任务列表
                                FPHDSdk.addSessionStorage("FPHDTaskSdkTaskList", JSON.stringify(dataObj.data.list));
                            }

                        },
                        onFail: function () {

                        }
                    });

                },

                openEgg: function openEgg(taskInfo, channelType) {

                    if (!taskInfo) {
                        return false;
                    }

                    var FPHDSdkUserInfo = FPHDSdk.getCookie('FPHDSdkUserInfo');
                    FPHDSdkUserInfo = decodeURIComponent(FPHDSdkUserInfo);
                    var FPHDSdkUserInfos = FPHDSdkUserInfo.split("||");

                    // 后端记录同一篇文章或视频只能出现一次彩蛋
                    var newsId = 0;
                    if (doingTaskList[taskInfo['id']].newsId) {
                        newsId = doingTaskList[taskInfo['id']].newsId;
                    }

                    var postUrl = taskApiServerUrl + "/task/openEgg?taskId=" + taskInfo['id'] + "&newsId=" + newsId + "&sign=" + FPHDSdkUserInfos[0] + "&time=" + FPHDSdkUserInfos[1] + "&token=" + FPHDSdkUserInfos[3];
                    FPHDSdk.doGet({
                        url: postUrl,
                        onSuccess: function (data) {
                            var dataObj = eval("(" + data.response + ")");//转换为json对象
                            if (dataObj.code === 0) {

                                // 开彩蛋，如果不是在文章详情页和视频页面则不创建计时圈
                                if (channelType == 1) {
                                    var articleDocumentObj = document.getElementById("commentScroll");
                                    if (FPHDSdk.dataIsNull(articleDocumentObj)) {
                                        FPHDTaskSdk._deleteBaseElement('FPHDTaskTimingTask');
                                        FPHDTaskSdk._showAwardModal(dataObj.data);
                                        return;
                                    }
                                }

                                // 开彩蛋，如果不是在文章详情页和视频页面则不创建计时圈
                                if (channelType == 2) {
                                    var videoDocumentObj = document.getElementById("video_box");
                                    if (FPHDSdk.dataIsNull(videoDocumentObj)) {
                                        FPHDTaskSdk._deleteBaseElement('FPHDTaskTimingTask');
                                        FPHDTaskSdk._showAwardModal(dataObj.data);
                                        return;
                                    }

                                    // 在视频待播放界面，未点击商品播放按钮前打开彩蛋，不需要把彩蛋切换为计时器
                                    if (!isStartVideoTimingTask) {
                                        FPHDTaskSdk._deleteBaseElement('FPHDTaskTimingTask');
                                        FPHDTaskSdk._showAwardModal(dataObj.data);
                                        return;
                                    }
                                }

                                var documentObj = document.getElementById('FPHDTaskTimingTask');
                                if (!FPHDSdk.dataIsNull(documentObj)) {
                                    documentObj.innerHTML = '';
                                }

                                // 视频的计时转圈是按时间来计算
                                var bottomCss = '';
                                if (channelType == 2) {
                                    bottomCss = 'bottom: 3rem;';
                                }

                                var html = '<div class="circle-bar" id="circle-bar-timing" style="font-size: 1rem;width: 1rem;height:1rem;position:absolute;right: 0.26rem;background-color: #FFC23B;border-radius: 50%;float: right;box-shadow: 0 0 8px #898989;' + bottomCss + '">' +
                                    '    <div id="circle-bar-award-timing"></div>' +
                                    '    <div class="circle-bar-left" id="circle-bar-left-timing" style="width: 1rem;height: 1rem;background-color: #FFFFFF;clip: rect(0, .5em, auto, 0);position: absolute;top: 0;right: 0;bottom: 0;left: 0;margin: auto;border-radius: 50%;"></div>' +
                                    '    <div class="circle-bar-right" id="circle-bar-right-timing" style="width: 1rem;height: 1rem;background-color: #FFFFFF;clip: rect(0, auto, auto, .5em);position: absolute;top: 0;right: 0;bottom: 0;left: 0;margin: auto;border-radius: 50%;"></div>' +
                                    '    <div class="mask" style="width: 0.85rem;height: 0.85rem;background-color: #fff;text-align: center;line-height: 0.2rem;color: rgba(0, 0, 0, 0.5);position: absolute;top: 0;right: 0;bottom: 0;left: 0;margin: auto;border-radius: 50%;">' +
                                    '        <img src="/task/hongbao1.png" style="width: 85%;height: 85%;position: absolute;top: 0;right: 0;bottom: 0;left: 0;margin: auto;border-radius: 50%;">' +
                                    '    </div>' +
                                    '</div>';
                                document.getElementById('FPHDTaskTimingTask').innerHTML = html;

                                // 视频的计时转圈是按时间来计算
                                if (channelType == 2) {
                                    videoTimePassTime = 0;
                                    FPHDTaskSdk._videoTimeProgressBar(taskInfo);
                                } else {
                                    timingTaskPassTime = 0;
                                }

                                FPHDTaskSdk._showAwardModal(dataObj.data);
                            }
                        },
                        onFail: function () {

                        }
                    });

                },

                _showTipsMessage: function _showTipsMessage(overTask, channelType, nowTaskInfo) {

                    // 日常任务
                    if (overTask['type'] == 1) {
                        var title = overTask['name'];

                        var html = '<div class="card" >' +
                            '    <div style="width: 2.5rem;padding-bottom: 0.2rem;background: rgba(0, 0, 0, 0.8);text-align: center;border-radius: 6px;position: relative;">' +
                            '        <img src="/task/jinbi2.png" alt="" style="width: 0.78rem;height: 0.78rem;margin-top: 0.4rem;">' +
                            '        <p style="font-size: 0.3rem;color: #FFB272;margin-top: 0.1rem;">' + title + '</p>' +
                            '        <p style="font-size: 0.3rem;color: #ffffff;margin-top: 0.1rem;">+' + overTask['awardNumber'] + '奖励金</p>' +
                            '    </div>' +
                            '</div>';

                        var documentObj = document.getElementById('FPHDTaskTipsMessage');
                        if (!FPHDSdk.dataIsNull(documentObj)) {
                            documentObj.innerHTML = '';
                        } else {
                            var fphdDiv = document.createElement("fphdtaskdiv");
                            fphdDiv.id = 'FPHDTaskTipsMessage';
                            fphdDiv.style.position = "fixed";
                            fphdDiv.style.zIndex = "9990";
                            fphdDiv.style.left = "33.5%";
                            fphdDiv.style.bottom = "45%";
                            document.body.appendChild(fphdDiv);
                        }

                        document.getElementById('FPHDTaskTipsMessage').innerHTML = html;

                        setTimeout(function () {
                            FPHDTaskSdk._deleteBaseElement('FPHDTaskTipsMessage');
                        }, 3000);

                        // 福利任务的提示
                    } else if (overTask['type'] == 3) {

                        var title = overTask['name'];

                        var html = '<div class="card" >' +
                            '    <div style="width: 8.812rem;padding-bottom: 0.2rem;background: rgba(0, 0, 0, 0.8);text-align: center;border-radius: 6px;position: relative;">' +
                            '        <img src="/task/jinbi2.png" alt="" style="width: 2.75rem;height: 2.75rem;margin-top: 0.6rem;">' +
                            '        <p style="font-size: 1.13rem;color: #FFB272;margin: 0.3rem 0 .45rem 0;">' + title + '</p>' +
                            '        <p style="font-size: 1.13rem;color: #ffffff;margin-top: 0.1rem;">+' + overTask['awardNumber'] + '奖励金</p>' +
                            '    </div>' +
                            '</div>';

                        var documentObj = document.getElementById('FPHDTaskTipsMessage');
                        if (!FPHDSdk.dataIsNull(documentObj)) {
                            documentObj.innerHTML = '';
                        } else {
                            var fphdDiv = document.createElement("fphdtaskdiv");
                            fphdDiv.id = 'FPHDTaskTipsMessage';
                            fphdDiv.style.position = "fixed";
                            fphdDiv.style.zIndex = "9990";
                            fphdDiv.style.left = "32.5%";
                            fphdDiv.style.bottom = "45%";
                            document.body.appendChild(fphdDiv);
                        }

                        document.getElementById('FPHDTaskTipsMessage').innerHTML = html;

                        setTimeout(function () {
                            FPHDTaskSdk._deleteBaseElement('FPHDTaskTipsMessage');
                        }, 3000);

                        // 移除计时器
                        FPHDTaskSdk._deleteBaseElement('FPHDTaskWelfareTask');

                        // 小区群任务的提示
                    } else if (overTask['type'] == 7) {

                        var title = overTask['name'] + ' ' + overTask['number'] + '/' + overTask['total'];
                        var awardDesc = '获得 +' + overTask['myActive'] + '个人活跃，+' + overTask['communityActive'] + '小区活跃';

                        var html = '<div class="card" >' +
                            '    <div style="width: 4.2rem;padding-bottom: 0.2rem;background: rgba(0, 0, 0, 0.8);text-align: center;border-radius: 6px;position: relative;">' +
                            '        <img src="/task/huoyuedu.png" alt="" style="width: 0.78rem;height: 0.78rem;margin-top: 0.4rem;">' +
                            '        <p style="font-size: 0.3rem;color: #FFB272;margin-top: 0.1rem;">' + title + '</p>' +
                            '        <p style="font-size: 0.2rem;color: #ffffff;margin-top: 0.1rem;">' + awardDesc + '</p>' +
                            '    </div>' +
                            '</div>';

                        var documentObj = document.getElementById('FPHDCommunityTaskTipsMessage');
                        if (!FPHDSdk.dataIsNull(documentObj)) {
                            documentObj.innerHTML = '';
                        } else {
                            var fphdDiv = document.createElement("fphdtaskdiv");
                            fphdDiv.id = 'FPHDCommunityTaskTipsMessage';
                            fphdDiv.style.position = "fixed";
                            fphdDiv.style.zIndex = "9990";
                            fphdDiv.style.left = "22.1%";
                            fphdDiv.style.bottom = "41%";
                            document.body.appendChild(fphdDiv);
                        }

                        document.getElementById('FPHDCommunityTaskTipsMessage').innerHTML = html;

                        setTimeout(function () {
                            FPHDTaskSdk._deleteBaseElement('FPHDCommunityTaskTipsMessage');
                        }, 3000);

                        // 红包任务  视频惊喜红包
                    } else if (overTask['type'] == 2 || overTask['type'] == 6) {

                        var title = '';
                        var desc = '';
                        if (overTask['type'] == 6) {

                            if (nowTaskInfo) {
                                title = '继续往下看 ' + nowTaskInfo.conditionNumber + ' 个小视频';
                                desc = '即可获得下一个红包';
                            } else {
                                title = '继续往下看小视频';
                                desc = '更多红包等着你';
                            }
                        } else {
                            title = '【红包任务】';
                            desc = overTask['name'] + '  ' + overTask['number'] + '/' + overTask['total'];
                        }

                        var html = '<div class="card">' +
                            '    <div style="text-align: center;position: relative;width:3.627rem ;">' +
                            '        <img src="/task/hongbao4.png" alt="" srcset="" style="width:3.627rem;height:4.5rem">' +
                            '        <img src="/task/close.png" alt="" style="width: 0.5rem;height: 0.5rem;margin-top: 10px;" onclick="FPHDTaskSdk._deleteBaseElement(\'FPHDTaskHongbaoTipsMessage\');">' +
                            '        <div style="font-size: 0.274rem;color: #FFE689; position: absolute;top: 2rem;width: 100%;text-align: center;">+<span style="font-size: 0.78rem;">' + overTask['awardNumber'] + '</span>奖励金</div>' +
                            '        <p style="font-size: 0.25rem;color: #eeeeee;position: absolute;top: 3.1rem;width: 100%;text-align: center;">' + title + '</p>' +
                            '        <p style="font-size: 0.25rem;color: #eeeeee;position: absolute;top: 3.5rem;width: 100%;text-align: center;">' + desc + '</p>' +
                            '    </div>' +
                            '</div>';

                        var documentObj = document.getElementById('FPHDTaskHongbaoTipsMessage');
                        if (!FPHDSdk.dataIsNull(documentObj)) {
                            documentObj.innerHTML = '';
                        } else {
                            var fphdDiv = document.createElement("fphdtaskdiv");
                            fphdDiv.id = 'FPHDTaskHongbaoTipsMessage';
                            fphdDiv.style.position = "fixed";
                            fphdDiv.style.zIndex = "9990";
                            fphdDiv.style.left = "26%";
                            fphdDiv.style.bottom = "35%";
                            document.body.appendChild(fphdDiv);
                        }

                        document.getElementById('FPHDTaskHongbaoTipsMessage').innerHTML = html;

                        setTimeout(function () {
                            FPHDTaskSdk._deleteBaseElement('FPHDTaskHongbaoTipsMessage');
                        }, 3000);

                        if (overTask['type'] == 6) {
                            // 移除红包
                            FPHDTaskSdk._deleteBaseElement('FPHDTaskVideoSurpriseHongbao');
                        }

                        // 计时任务和发现任务
                    } else if (overTask['type'] == 4 || overTask['type'] == 5) {
                        var html = '<p style="position: absolute;top: -0.7rem;font-size: 0.47rem;color: #FF9F48;width: 100%;text-align: center;">+' + overTask['awardNumber'] + '</p>';

                        var baseElementId = '';
                        if (overTask['type'] == 4) {
                            baseElementId = 'circle-bar-award-timing';
                            document.getElementById(baseElementId).innerHTML = html;

                            // 判断计时任务是否能触发彩蛋
                            if (overTask['showEgg'] == 1) {

                                setTimeout(function () {
                                    var documentObj = document.getElementById('FPHDTaskTimingTask');
                                    if (!FPHDSdk.dataIsNull(documentObj)) {
                                        documentObj.innerHTML = '';
                                    }

                                    var eggCss = '';
                                    if (channelType == 2 && overTask['channelType'].indexOf(2) != -1) {
                                        eggCss = 'margin-top: -4.3rem;';
                                    } else {
                                        eggCss = 'margin-bottom: -0.8rem;';
                                    }

                                    var eggHtml = '<div id="circle-bar-award-timing-egg" style="margin-right: 0.18rem;' + eggCss + '"><img src="/task/caidan.gif" alt="" style="width: 1.5rem;height:auto;" onclick=\'FPHDTaskSdk.openEgg(' + JSON.stringify(overTask) + ', ' + channelType + ');\'></div>';
                                    document.getElementById('FPHDTaskTimingTask').innerHTML = eggHtml;
                                }, 2000);
                            } else {
                                setTimeout(function () {
                                    document.getElementById(baseElementId).innerHTML = '';
                                }, 2000);
                            }


                        } else {
                            baseElementId = 'circle-bar-award-find';
                            document.getElementById(baseElementId).innerHTML = html;
                            setTimeout(function () {
                                FPHDTaskSdk._deleteBaseElement('FPHDTaskFindTask');
                            }, 2000);
                        }

                    }

                },

                _showMixTipsMessage: function _showMixTipsMessage(overTaskList, channelType) {

                    // 如果弹窗已经存在，则追加内容
                    var mixTipsMessageObj = document.getElementById('mixTipsMessageContent');

                    if (mixTipsMessageObj) {
                        var html = '';
                    } else {
                        var html = '<div id="mixTipsMessageContent" style="margin: 50% auto 0 auto;display: flex;background: #F7F0E5;width: 90%;border-radius: 6px;position: relative;">' +
                            '<img src="/task/awardTitle.png" style="width: 3rem;height:auto;position: absolute;left: 50%;margin-left: -1.5rem;top: -0.45rem;">';
                    }

                    for (var i = 0; i < overTaskList.length; i++) {

                        var overTask = overTaskList[i];

                        // 日常任务
                        if (overTask['type'] == 1) {

                            var title = overTask['name'];

                            html += '<div class="mixTipsMessageCard" style="text-align: center;flex: 1;padding: 10% 0;">' +
                                '    <div class="bg" style="width: 1.58rem;height: 1.58rem;display: inline-block;background-image: url(/task/awardBg.png);background-repeat:no-repeat;background-size:100% 100%;">' +
                                '        <img src="/task/jinbi2.png" style="width: 1.18rem;height: 1.18rem;margin-top: 0.2rem;" >' +
                                '    </div>' +
                                '    <p style="font-size: 0.28rem;color: #333333;margin-top: 0.2rem;">' + title + '</p>' +
                                '    <p style="font-size: 0.22rem;width: 1.9rem;margin: 0.1rem auto;text-align: center;">+' + overTask['awardNumber'] + '奖励金</p>' +
                                '</div>';

                            // 小区群任务的提示
                        } else if (overTask['type'] == 7) {

                            var title = overTask['name'] + ' ' + overTask['number'] + '/' + overTask['total'];
                            var awardDesc = '获得 +' + overTask['myActive'] + '个人活跃，+' + overTask['communityActive'] + '小区活跃';

                            html += '<div class="mixTipsMessageCard" style="text-align: center;flex: 1;padding: 10% 0;">' +
                                '    <div class="bg" style="width: 1.58rem;height: 1.58rem;display: inline-block;background-image: url(/task/awardBg.png);background-repeat:no-repeat;background-size:100% 100%;">' +
                                '        <img src="/task/huoyuedu.png" style="width: 1.18rem;height: 1.18rem;margin-top: 0.2rem;" >' +
                                '    </div>' +
                                '    <p style="font-size: 0.28rem;color: #333333;margin-top: 0.2rem;">' + title + '</p>' +
                                '    <p style="font-size: 0.22rem;width: 1.9rem;margin: 0.1rem auto;text-align: center;">' + awardDesc + '</p>' +
                                '</div>';

                            // 红包任务  视频惊喜红包
                        } else if (overTask['type'] == 2 || overTask['type'] == 6) {

                            var title = '';
                            var desc = '';
                            if (overTask['type'] == 6) {
                                title = '继续往下看小视频';
                                desc = '更多红包等着你';
                            } else {
                                title = '【红包任务】';
                                desc = overTask['name'] + '  ' + overTask['number'] + '/' + overTask['total'];
                            }

                            html += '<div class="mixTipsMessageCard" style="text-align: center;flex: 1;padding: 10% 0;">' +
                                '    <div class="bg" style="width: 1.58rem;height: 1.58rem;display: inline-block;background-image: url(/task/awardBg.png);background-repeat:no-repeat;background-size:100% 100%;">' +
                                '        <img src="/task/shipinhongbao.png" style="width: 1.18rem;height: 1.18rem;margin-top: 0.2rem;" >' +
                                '    </div>' +
                                '    <p style="font-size: 0.28rem;color: #333333;margin-top: 0.2rem;">+' + overTask['awardNumber'] + '奖励金</p>' +
                                '    <p style="font-size: 0.22rem;width: 1.9rem;margin: 0.1rem auto;text-align: center;">' + title + '</p>' +
                                '    <p style="font-size: 0.22rem;width: 1.9rem;margin: 0.1rem auto;text-align: center;">' + desc + '</p>' +
                                '</div>';


                            if (overTask['type'] == 6) {
                                // 移除红包
                                FPHDTaskSdk._deleteBaseElement('FPHDTaskVideoSurpriseHongbao');
                            }

                            // 计时任务和发现任务
                        } else if (overTask['type'] == 4 || overTask['type'] == 5) {

                            var messagehtml = '<p style="position: absolute;top: -0.7rem;font-size: 0.47rem;color: #FF9F48;width: 100%;text-align: center;">+' + overTask['awardNumber'] + '</p>';

                            var baseElementId = '';
                            if (overTask['type'] == 4) {
                                baseElementId = 'circle-bar-award-timing';
                                document.getElementById(baseElementId).innerHTML = messagehtml;

                                // 判断计时任务是否能触发彩蛋
                                if (overTask['showEgg'] == 1) {

                                    setTimeout(function () {
                                        var documentObj = document.getElementById('FPHDTaskTimingTask');
                                        if (!FPHDSdk.dataIsNull(documentObj)) {
                                            documentObj.innerHTML = '';
                                        }

                                        var eggCss = '';
                                        if (channelType == 2 && overTask['channelType'].indexOf(2) != -1) {
                                            eggCss = 'margin-top: -3.3rem;';
                                        } else {
                                            eggCss = 'margin-bottom: -0.8rem;';
                                        }

                                        var eggHtml = '<div id="circle-bar-award-timing-egg" style="margin-right: 0.18rem;' + eggCss + '"><img src="/task/caidan.gif" alt="" style="width: 1.5rem;height:auto;" onclick=\'FPHDTaskSdk.openEgg(' + JSON.stringify(overTask) + ', ' + channelType + ');\'></div>';
                                        document.getElementById('FPHDTaskTimingTask').innerHTML = eggHtml;
                                    }, 2000);
                                } else {
                                    setTimeout(function () {
                                        document.getElementById(baseElementId).innerHTML = '';
                                    }, 2000);
                                }


                            } else {
                                baseElementId = 'circle-bar-award-find';
                                document.getElementById(baseElementId).innerHTML = messagehtml;
                                setTimeout(function () {
                                    FPHDTaskSdk._deleteBaseElement('FPHDTaskFindTask');
                                }, 2000);
                            }

                        }

                    }

                    if (mixTipsMessageObj) {
                        mixTipsMessageObj.innerHTML += html;
                    } else {
                        html += '</div>' +
                            '<div style="text-align: center;margin-top: 0.3rem;position: relative;"><img src="/task/close.png" alt="" style="width: 0.5rem;height: 0.5rem;" onclick="FPHDTaskSdk._deleteBaseElement(\'FPHDTaskMixTipsMessage\');"></div>';

                        FPHDTaskSdk._createBaseElement('FPHDTaskMixTipsMessage', html);
                    }

                    var length = document.getElementsByClassName('mixTipsMessageCard').length;
                    if (length == 1) {
                        document.getElementById('mixTipsMessageContent').style.width = '4.74rem';
                    } else if (length == 2) {
                        document.getElementById('mixTipsMessageContent').style.width = '4.74rem';
                    } else if (length == 3) {
                        document.getElementById('mixTipsMessageContent').style.width = '90%';
                    }

                },

                _showAwardModal: function _showAwardModal(info) {

                    var html = '<div class="card">' +
                        '    <div style="width: 5.74rem;position: relative;margin: 50% auto 0 auto;">' +
                        '        <img src="/task/header.png" alt="" style="width: 100%;">' +
                        '        <div style="position: absolute;font-size: 0.4rem;left: 2.1rem;top: 1.8rem;font-weight: bold;color: #73380C;">恭喜获得</div>' +
                        '        <div style="width: 100%;height: 2rem;background: #ffffff;text-align: center;margin-top: -0.7rem;">' +
                        '            <p style="font-size:0.3rem;color: #F96634;margin: 0.3rem 0;">+<span style="font-size: 0.94rem;">' + info.awardNumber + '</span>奖励金</p>' +
                        '            <p style="color: #999999; font-size: 0.21rem;"><img src="/task/jinbi3.png" style="width: 0.3rem;height: 0.3rem;vertical-align: middle;margin-top: -0.05rem;" alt=""> ' + info.awardNumber + '可抵扣<span style="color:#F96634">=' + info.money + '元</span></p>' +
                        '        </div>' +
                        '        <div style="text-align: center;margin-top: 0.3rem;"><img src="/task/close.png" alt="" style="width: 0.5rem;height: 0.5rem;" onclick="FPHDTaskSdk._deleteBaseElement(\'FPHDTaskAwardModal\');"></div>' +
                        '    </div>' +
                        '</div>';

                    FPHDTaskSdk._createBaseElement('FPHDTaskAwardModal', html);
                }

            };
        }

    ]);
});
